package main

import (
	_ "embed"
	"log"

	"gitee.com/z1gotool/z1cnf"
)

// run the cmd " go run . " to create config.yaml,then you can use z1cnf.Get(“)
// var _ = z1cnf.GenConfigTemplate() // gen config template, just in dev
//
//go:embed config/config_template.yaml
var z1cnfContent []byte
var _ = z1cnf.SetConfigTemplate(z1cnfContent)

// run the cmd " go generate " to generate cnf2struct,then you can use z1cnf.Struct
//go:generate go run gitee.com/z1gotool/z1cnf/cnf2struct

func main() {

	log.Println("----------use config by struct,start-----------")
	log.Println(z1cnf.Get(``))
	log.Println(z1cnf.Struct)
	log.Println("----------use config by struct,end-----------")

}
